class Screen
  def initialize
    init_screen
    curs_set 0
    noecho
    start_color
    use_default_colors
    init_pair 0, COLOR_WHITE, COLOR_BLACK
    init_pair 1, COLOR_RED, COLOR_BLACK
    init_pair 2, COLOR_GREEN, COLOR_BLACK
    init_pair 3, COLOR_YELLOW, COLOR_BLACK
    init_pair 4, COLOR_BLUE, COLOR_BLACK
    init_pair 5, COLOR_MAGENTA, COLOR_BLACK
    init_pair 6, COLOR_CYAN, COLOR_BLACK
    init_pair 7, COLOR_WHITE, COLOR_BLACK
    init_pair 8, COLOR_RED, COLOR_BLACK
    init_pair 9, COLOR_GREEN, COLOR_BLACK
    init_pair 10, COLOR_YELLOW, COLOR_BLACK
    init_pair 11, COLOR_BLUE, COLOR_BLACK
    init_pair 12, COLOR_MAGENTA, COLOR_BLACK
    init_pair 13, COLOR_CYAN, COLOR_BLACK
  end
  def draw
    # draw objects
    $currentmap.draw
    $player.draw
    $msgbox.draw

    # draw player info
    setpos 0, $map_width + 1
    addstr $player.getname
    setpos 1, $map_width + 1
    addstr "HP: #{$player.gethp} MP: #{$player.getmp}"

    # draw debug info
    setpos $map_height - 3, $map_width + 1
    addstr "turn: #{$player.turns?}"
    setpos $map_height - 2, $map_width + 1
    addstr "world x: #{$currentmap.getx} world y: #{$currentmap.gety}"
    setpos $map_height - 1, $map_width + 1
    addstr "player x: #{$player.getx} player y: #{$player.gety}"
  end
  def refresh
    clear
  end
  def close
    close_screen
  end
end